use core::prelude::{BizError, BizResult, biz_err, biz_ok};

use crate::domain::entity::User;

pub struct UserService {}

impl UserService {
    pub fn get_by_id(user_id: u64) -> BizResult<User> {
        if user_id == 1 {
            biz_err(BizError::NotFoundError(format!(
                "user_id: {} not found",
                user_id
            )))
        } else {
            biz_ok(User {
                id: user_id,
                name: "test".to_owned(),
                email: "".to_owned(),
            })
        }
    }
}
